<template lang="pug">
el-table(:data="data")
    el-table-column(prop="name" label="姓名")
    el-table-column(prop="age" label="年龄")
    el-table-column(label="操作")
      template(#default="scope") 
        el-button(@click="pageList.handleDelete(scope.row)" type="text" size="small") 删除
el-pagination( layout="prev, pager, next" :total="pageList.total" 
:page-size="10" :current-page="1"  @current-change="pageList.pageCurrentChangeHandle")
</template>

<script>
import {defineComponent,onMounted, reactive,onActivated} from 'vue'
import PageList,{RequestUrl} from '@/utils/listTable/index'
export default defineComponent({

setup(){
    const rurl= new RequestUrl('/zjh/api/userlogin/getlist')
    const pageList =  new PageList(rurl,{},false); 
    const data = reactive([]);
    onMounted(async ()=>{
        const list= await pageList.getDataList();
        for (let index = 0; index < list.length; index++) {
            data.push(list[index]);
        }
        console.log(data)
    }) 
    return  { data,pageList }
}
    


})
</script>

 